#ifndef RENDERTARGET_H
#define RENDERTARGET_H

#include <QObject>
#include <QVector2D>
#include <qopengltexture.h>

class RenderTarget:public QObject
{
    Q_OBJECT
public:
    RenderTarget(QString path = "",QVector2D pos = QVector2D(0,0),int layer = 0,float sizeTimes = 1);
    RenderTarget(const RenderTarget& rt);
    ~RenderTarget();
    void Activate();//创建纹理
    void SetWidth(float w);
    void SetHeight(float h);
    float GetWidth();
    float GetHeight();
    void SetSize(QSize s);
    QVector2D GetPos();
    void SetPos(QVector2D p);
    void SetLayer(int layer);
    int GetLayer();
    QOpenGLTexture* GetTexture();
    QString GetPath();
    float sizeTimes = 1.00f;//缩放的大小，初始为100%（铺满窗口）
    QVector2D* size = nullptr;
private:
    float width = 0.0f;
    float height = 0.0f;
    int layer = 0;
    QOpenGLTexture* texture = nullptr;
    QVector2D pos = QVector2D(0,0);
    QString path = "";
};

#endif // RENDERTARGET_H
